package org.ciallo.easytokencore.exception;

import org.ciallo.easytokencore.error.EasyErrorCode;

/**
 * Easy-Token 校验失败异常
 *
 * <p>异常场景：</p>
 * <ul>
 *   <li>Token签名验证失败</li>
 *   <li>Token格式不正确</li>
 *   <li>Token已被篡改</li>
 *   <li>Token解析失败</li>
 * </ul>
 *
 * <p>继承关系：</p>
 * <ul>
 *   <li>继承自EasyTokenException</li>
 *   <li>默认使用CODE_INVALID_TOKEN错误码(799)</li>
 * </ul>
 *
 * <p>使用示例：</p>
 * <pre>
 * {@code
 * if(!verifyToken(token)) {
 *     throw new EasyTokenInvalidException("Token校验失败")
 *         .setCode(EasyErrorCode.CODE_INVALID_TOKEN);
 * }
 * }
 * </pre>
 *
 * @Description: Easy-Token 令牌校验失败异常
 * @Author: Jukomu
 * @Package: org.ciallo.easytokencore.exception
 * @Project: easy-token-demo
 * @Version: 1.0.0
 * @name: EasyTokenInvalidException
 * @Date: 2025-05-06
 * @Filename: EasyTokenInvalidException
 * @see EasyTokenException
 * @see EasyErrorCode#CODE_INVALID_TOKEN
 */
public class EasyTokenInvalidException extends EasyTokenException {
    /**
     * 一个异常：代表 Easy-Token 校验未通过
     *
     * @param message 异常描述
     */
    public EasyTokenInvalidException(String message) {
        super(message);
    }

    public EasyTokenInvalidException(int code, String message) {
        super(code, message);
    }

}
